package com.hdu.guahao.hosp.controller;

import com.hdu.guahao.common.result.Result;
import com.hdu.guahao.hosp.service.DepartmentService;
import com.hdu.hospital.vo.hosp.DepartmentVo;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
//@CrossOrigin
@RequestMapping("/admin/hosp/department")
public class DepartmentController {

    @Autowired
    private DepartmentService departmentService;

    @ApiOperation("查询所有科室")
    @GetMapping("getDeptList/{hoscode}")
    public Result getDeptList(@PathVariable String hoscode){
        List<DepartmentVo> departmentVos =  departmentService.findDeptTree(hoscode);
        return Result.ok(departmentVos);
    }
}
